﻿//https://leetcode.cn/problems/di-string-match/

class Solution {
public:
    vector<int> diStringMatch(string s)
    {
        vector<int> ret;
        int left = 0, right = s.size();
        for (auto& ch : s)
        {
            if (ch == 'I') ret.push_back(left++);
            else ret.push_back(right--);
        }

        ret.push_back(left);

        return ret;

    }
};